﻿<Modal @ref="@ModalRef" Closing="@OnModalClosing">
    <ModalBackdrop />
    <ModalContent Centered="@CenterMessage">
        <ModalHeader>
            <ModalTitle>
                @Title
            </ModalTitle>
        </ModalHeader>
        <ModalBody>
            @if ( ShowMessageIcon )
            {
                <DisplayHeading Size="DisplayHeadingSize.Is2" Alignment="TextAlignment.Center">
                    <Icon Name="@MessageIcon" Style="@MessageIconStyle" />
                </DisplayHeading>
            }
            <Text Alignment="TextAlignment.Center">
                @Message
            </Text>
        </ModalBody>
        <ModalFooter>
            @if ( IsConfirmation )
            {
                <Button Color="Color.Danger" Padding="Padding.Is2.OnX" Clicked="@OnCancelClicked">
                    @if ( Options?.CancelButtonIcon != null )
                    {
                        <Icon Name="@Options.CancelButtonIcon" Margin="Margin.Is2.FromRight" />
                    }
                    @CancelButtonText
                </Button>
                <Button Color="Color.Primary" Padding="Padding.Is2.OnX" Clicked="@OnConfirmClicked">
                    @if ( Options?.ConfirmButtonIcon != null )
                    {
                        <Icon Name="@Options.ConfirmButtonIcon" Margin="Margin.Is2.FromRight" />
                    }
                    @ConfirmButtonText
                </Button>
            }
            else
            {
                <Button Color="Color.Primary" Padding="Padding.Is2.OnX" Clicked="@OnOkClicked">
                    @if ( Options?.OkButtonIcon != null )
                    {
                        <Icon Name="@Options.OkButtonIcon" Margin="Margin.Is2.FromRight" />
                    }
                    @OkButtonText
                </Button>
            }
        </ModalFooter>
    </ModalContent>
</Modal>